var markup_header =
'<div class="breadcrumb">\
	 <span>##title##</span>\
</div>';

var markup_album =
'<div class="##album_type##_block">\
    <div class="##album_type##_block_pic"></div>\
     <div class="##album_type##_name">\
         ##name##\
     </div>\
     <div class="##album_type##_control">\
         <span class="edit_##album_type##album"></span>\
         <span class="delete_##album_type##album"></span>\
     </div>\
     <input type="hidden" value="##album_id##">\
 </div>';
 
 var markup_album_wrap =
 '<div id="##album_type##album_wrap">\
	 <div id="##album_type##album_list">\
	 </div>\
	 <input type="button" class="button" name="new_##album_type##_album" value="Создать альбом">\
</div>';

var markup_album_wrap_no =
'<div id="##album_type##album_wrap">\
	 <div id="##album_type##album_list">\
		 <span class="no_album"> Нет ни одного созданного альбома</span>\
	 </div>\
	 <input type="button" class="button" name="new_##album_type##_album" value="Создать альбом">\
 </div>';
 
 var button_load_photo='<input type="button" class="button" name="upload_photo_btn" value="Загрузить новое фото">';
 var button_load_video='<input type="button" class="button" name="upload_video_btn" value="Загрузить видео с YouTube">';
 
 var markup_no_photos_in_photoalbum =
'<div id="photoalbum_wrap">\
	 <div id="photoalbum_gallery">\
		 <span class="no_photos"> Нет ни одной загруженной фотографии</span>\
	 </div>\
	 <input type="button" class="button" name="upload_photo_btn" value="Загрузить новое фото">\
     <input type="hidden" name="upload">\
 </div>';
 
  var markup_no_videos_in_videoalbum =
'<div id="videoalbum_wrap">\
	 <div id="videoalbum_gallery">\
		 <span class="no_photos"> Нет ни одного загруженного видео</span>\
	 </div>\
     <input type="button" class="button" name="upload_video_btn" value="Загрузить видео с YouTube">\
 </div>';
 
 var ajax_album_loader= 
 '<div id="ajax_loader_album">\
 </div>'
 
 var markup_photo_block_wrap= 
 '<div id="photoalbum_wrap">\
     <div id="photoalbum_gallery">\
          <div id="photoalbum_gallery_list">\
         </div>\
      </div>\
</div>'

 var markup_video_block_wrap= 
 '<div id="videoalbum_wrap">\
     <div id="videoalbum_gallery">\
          <div id="videoalbum_gallery_list">\
         </div>\
      </div>\
</div>'
 
 var ajax_album_loader_present= 
 '<div id="ajax_loader_album_present">\
 </div>'
 
 var markup_photo_block=
 '<div class="photo_block_current">\
     <a class="gallery" rel="prettyPhoto[gallery1]" title="##photo_title##" href="user_photos/full_size/##photo_link##">\
         <img src="user_photos/mini/##photo_link##" />\
     </a>\
     <div class="photo_description">\
    ##photo_title_short##\
     </div>\
     <div class="photo_control">\
         <span class="edit_photoalbum"></span>\
         <span class="delete_photoalbum"></span>\
     </div>\
 </div>';
 
 var markup_video_block=
 '<div class="video_block_current">\
     <img src="http://img.youtube.com/vi/##link_key##/1.jpg" video="##link_key##" alt="##video_title##" />\
     <div class="video_description">\
     ##video_title_short##\
     </div>\
     <div class="video_control">\
         <span class="edit_videoalbum"></span>\
         <span class="delete_videoalbum"></span>\
     </div>\
 </div>';
 
 var markup_video_wrap_content=
 '<div id="videoalbum_gallery">\
     <div id="videoalbum_gallery_list">\
     </div>\
     <input type="button" class="button" name="upload_video_btn" value="Загрузить видео с YouTube">\
 </div>';
 
 var markup_photos_form=
 '<form id="imageform" method="post" enctype="multipart/form-data" action="upload_photos.php" style="clear:both; display:none">\
     <div id="imageloadstatus" style="display:none"><img src="images/ajax-loader.gif" alt="Uploading...."/></div>\
     <div id="imageloadbutton">\
     <input type="file" name="photos[]" id="photoimg" multiple="true" />\
     </div>\
</form>';

var mail_container=
'<div id="mail-container">\
	 <div id="mail-msg-list">\
	 </div>\
</div>';

var markup_message=
'<div class="mail-msg">\
<input type="hidden" name="mess_id" value="##message_id##" />\
<input type="hidden" name="sender_id" value="##sender_id##" />\
<input type="hidden" name="receiver_id" value="##receiver_id##" />\
<input type="hidden" name="sender_ava" value="##sender_ava##" />\
<input type="hidden" name="receiver_ava" value="##receiver_ava##" />\
<input type="hidden" name="my_id" value="##my_id##" />\
	<div class="mail-msg-left">\
		<div class="mail-user">\
			<a target="_blank" href="user_profile.php?id=##sender_id##">\
				<img width="50" height="50" border="0" src="##sender_ava##">\
			</a>\
			<span class="mail-user-status"></span>\
		</div>\
	<div class="mail-user2">\
			<a target="_blank" href="user_profile.php?id=##receiver_id##">\
				<img width="50" height="50" border="0" src="##receiver_ava##">\
			</a>\
			<span class="mail-user-status"></span>\
		</div>\
	</div>\
	<div class="mail-msg-right">\
		<div class="mail-content">\
			<span class="mail-date-create">Отправлено: ##date##</span>\
			<p>##message##\
			</p>\
		</div>\
	</div>\
	<div class="clear"></div>\
</div>';
 
var mail_write_wrapper=
'<div id="mail-write-wrapper" style="display: none">\
	 <div id="mail-history">\
	 </div>\
	 <div id="mail-write">\
		 <form method="post" action="javascript:void(null);" >\
			<textarea name="text" cols="100" rows="10" class="mail-text"></textarea>\
			 <button name="btn_send" class="button" onclick="send_message();">Отправить</button>\
		 </form>\
	 </div>\
</div>';

var mail_msg_me=
'<div class="mail-msg-me">\
	<div style="background: rgba(255, 255, 118, 0.3); float: left; width: 85%; height: 100%">\
		<div style="border: 1px solid rgba(223, 223, 103, 0.5); height: 94%; margin: 2px">\
			<span class="mail-date-create" style="padding: 6px 6px 0 6px">Отправлено: ##date##</span>\
			<p style="padding: 0 6px 6px 6px">\
			 ##message##\
			</p>\
		</div>\
	</div>\
	<div style="float: right; width: 15%; height: 100%; text-align: center; position: relative">\
		<img src="##ava_me##" width="46" height="46" style="margin-top: 2px; border-radius: 5%; box-shadow: 1px 1px 4px 0px #000">\
	</div>\
	<div class="clear"></div>\
</div>'; 

var mail_msg_person=
'<div class="mail-msg-person">\
	<div style="background: rgba(213, 213, 214, 0.3); float: right; width: 85%; height: 100%">\
		<div style="border: 1px solid rgba(107, 127, 206, 0.5); height: 94%; margin: 2px;">\
			<span class="mail-date-create" style="padding: 6px 6px 0 6px">Отправлено: ##date##</span>\
			<p style="padding: 0 6px 6px 6px">\
			 ##message##\
			</p>\
		</div>\
	</div>\
	<div style="float: left; width: 15%; height: 100%; text-align: center; position: relative">\
		 <img src="##ava_person##" width="46" height="46" style="margin-top: 2px; border-radius: 5%; box-shadow: 1px 1px 4px 0px #000">\
	</div>\
	<div class="clear"></div>\
</div>';

var mail_msg_separate=
'<div class="mail-msg-separate" style="width: 60px; height: 1px; background: rgba(107, 127, 206, 0.5); margin-left: 6px"></div>';

var short_message=
'<span class="mail-date-create" style="padding: 6px 6px 0 6px">Отправлено: ##date##</span>\
<p style="padding: 0 6px 6px 6px">\
 ##message##\
</p>';

/**
* Шаблоны для поисковой страницы
*/
var markup_lifter_block=

'<div class="lifter_block">\
	 <div class="lifter_photo">\
		 <div class="lifter_photo_pic">\
			 <a target="_blank" href="user_profile.php?id=##user_id##"><img src="##user_ava_150##"/></a>\
			 <span class="##online_status##">\
					 ##status_text##\
			 </span>\
		 </div>\
		 <div class="lifter_small_info">\
			 <div class="lifter_name_age">\
				 <a target="_blank" href="user_profile.php?id=##user_id##">##user_first_last_name##</a>\
			 </div>\
			 <div class="lifter_contry">\
				 ##country####city##\
			 </div>\
		 </div>\
	 </div>\
	 <div class="lifter_info">\
		 <table>\
			 <tr>\
				 <td>\
					 <b>Возраст:</b>\
				 </td>\
				 <td>\
					 ##age## \
				 </td>\
			 </tr>\
			 <tr>\
				 <td>\
					 <b>Приседания:</b>\
				 </td>\
				 <td>\
					 ##squat## \
				 </td>\
			 </tr>\
			 <tr>\
				 <td>\
					<b>Жим:</b>\
				 </td>\
				 <td>\
					 ##b_press## \
				 </td>\
			 </tr>\
			  <tr>\
				 <td>\
					 <b>Тяга:</b>\
				 </td>\
				 <td>\
					 ##d_lift## \
				 </td>\
			 </tr>\
			  <tr>\
				 <td>\
					 <b>Сумма троеборья:</b>\
				 </td>\
				 <td>\
					 ##total##\
				 </td>\
			 </tr>\
			  <tr>\
				 <td>\
					 <b>Звание/разряд:</b>\
				 </td>\
				 <td>\
					 ##rang##\
				 </td>\
			 </tr>\
			  <tr>\
				 <td>\
					 <b>Федерация:</b>\
				 </td>\
				 <td>\
					 ##federation##\
				 </td>\
			 </tr>\
		 </table>\
		 <div class="actions_btn">\
			 <input type="button" value="##friend_btn_name##" onclick="##function##" name="friend_btn" class="button">\
			 <img title="Написать сообщение" name="quick_message" src="images/email_btn.png">\
	 </div>\
	 <input type="hidden" name="user_id" value="##user_id##">\
	 </div>	\
	 <div class="clear"></div>\
 </div>';

var markup_advert_in_search_block=

'<div class="advert_block">\
	 <div class="article_info">\
		 <table>\
			 <tr>\
				 <td>\
					 <b>Рубрика:</b>\
				 </td>\
				 <td>\
					 ##rubric_type##\
				 </td>\
			 </tr>\
			 <tr>\
				 <td>\
					 <b>Категория:</b>\
				 </td>\
				 <td>\
					 ##kateg_type##\
				 </td>\
			 </tr>\
			 <tr>\
				 <td>\
					 <b>Добавлено:</b>\
				 </td>\
				 <td>\
					 ##date##\
				 </td>\
			 </tr>\
			 <tr>\
				 <td>\
					 <b>Добавил:</b>\
				 </td>\
				 <td>\
					 <a class="first_last_name" href="user_profile.php?id=##user_id##">##user_name##</a>\
				 </td>\
			 </tr>\
		 </table>\
	 </div>\
	 <div class="advert_content">\
		##advert_text##\
	 </div>\
	 <input class="button" type="button" name="advert_contact_popup" value="Контактные данные"/>\
	 <input type="hidden" name="id" value="##advert_id##"/>\
	 <input type="hidden" name="phone_h" value="##phone_h##"/>\
	 <input type="hidden" name="email_h" value="##email_h##"/>\
	 <input type="hidden" name="scype_h" value="##scype_h##"/>\
 </div>';
 
 var markup_my_advert_block=
 
 '<div class="advert_block">\
	 <div class="advert_info">\
		 <table>\
			 <tr>\
				 <td>\
					 <b>Рубрика:</b>\
				 </td>\
				 <td>\
					 ##rubric##\
				 </td>\
			 </tr>\
			 <tr>\
				 <td>\
					 <b>Категория:</b>\
				 </td>\
				 <td>\
					 ##categ##\
				 </td>\
			 </tr>\
			 <tr>\
				 <td>\
					 <b>Добавлено:</b>\
				 </td>\
				 <td>\
					 ##date##\
				 </td>\
			 </tr>\
		 </table>\
	 </div>\
	 <div class="advert_content">\
		##text##\
	 </div>\
	 <input class="button" name="edit" type="button" value="Редактировать"/>\
	 <input class="button" name="delete" type="button" value="Удалить"/>\
	 <input type="hidden" name="id" value="##advert_id##"/>\
	 <input type="hidden" name="phone_h" value="##phone_h##"/>\
	 <input type="hidden" name="email_h" value="##email_h##"/>\
	 <input type="hidden" name="scype_h" value="##scype_h##"/>\
 </div>';
 
 var markup_wrap_search_block='<div class="wrap_search_block"></div>';
 var markup_button_new_advert='<input type="button" name="new_advert" value="подать новое объявление" class="button" style="margin-top:12px;">';
 var markup_no_my_adverts=
 '<span class="no_photos"> Нет ни одного созданного объявления</span>\
 <input type="button" name="new_advert" value="подать новое объявление" class="button" style="margin-top:12px;">';
 
 var ajax_search_result_block=
 
 '<div class="ajax_search_result">\
	 <h2>\
		 <span>##found## ##what_is_find##: <b>##count_result##</b></span>\
		 <div class="search_paginator">	\
		 </div>\
		 <div class="clear"></div>\
	 </h2>\
	<div id="##block_type##">\
		 <div class="clear"></div>\
	</div>\
	<div class="search_paginator">\
	</div>\
 </div>';
 
/**
*/

var markup_back_user_profile=
'<div id="action_btn_blue">\
	 <input type="button" class="button" name="back_btn" value="Назад" onclick="back_user_profile(\'##user_id##\')">\
	  <input type="hidden" name="user_id" value="##user_id##"/>\
</div>';

var markup_back_user_profile_album=
'<div id="action_btn_blue">\
	 <input type="button" class="button" name="back_btn" value="Назад" onclick="get_albums_of_user(\'##album_type##\',##user_id## )">\
	  <input type="hidden" name="user_id" value="##user_id##"/>\
</div>';

var markup_news_filters=
 '<div class="content-filter">\
	 <b>\
		 Отображать:\
	 </b>\
	 <input type="checkbox" class="checkbox" name="photo_news" checked /><span>Фото</span>\
	 <input type="checkbox" class="checkbox" name="video_news" checked /><span>Видео</span>\
	 <input type="checkbox" class="checkbox" name="advert_news" checked />Объявления</span>\
	 <div class="clear"></div>\
 </div>';
 
 var markup_news_main=
 '<div class="news">\
	 <h2>\
		 <span>Найдено новостей: <b>##count_result##</b></span>\
		 <div class="search_paginator">	\
		 </div>\
		 <div class="clear"></div>\
	 </h2>\
	 <ul></ul>\
	 <div class="search_paginator">	\
	 </div>\
</div>';
 
  var markup_news_video=
  '<li>\
	 <div class="right">\
		 <ul>\
			 <li class="news_btn">\
				 <b class="like_count">##like_count##</b>\
				 <span class="like_icon" title="Проголосовать"></span>\
				 <div class="clear"></div>\
			 </li>\
			 <li class="news_btn">\
				 <b class="unlike_count">##unlike_count##</b>\
				 <span class="unlike_icon" title="Проголосовать"></span>\
				 <div class="clear"></div>\
			 </li>\
			 <li class="news_btn">\
				 <div id="news_icon_comments">\
					 <b>Комментариев: <span>##comments_count##</span></b>\
				 </div>\
			 </li>\
			  <li class="news_btn">\
				 <span class="socnet_fb" onclick="share(\'fb\', this, \'##title##\')" title="Поделиться новостью в Фейсбуке"></span>\
				 <span class="socnet_tw" onclick="share(\'tw\', this, \'##title##\')" title="Поделиться новостью в Твиттере"></span>\
				 <span class="socnet_vk" onclick="share(\'vk\', this, \'##title##\')" title="Поделиться новостью в Вконтакте"></span>\
				 <span class="socnet_ok" onclick="share(\'ok\', this, \'##title##\')" title="Поделиться новостью на Одноклассниках"></span>\
				 <span class="socnet_gp" onclick="share(\'gp\', this, \'##title##\')" title="Поделиться новостью в Google+"></span>\
				 <span class="socnet_mail" onclick="share(\'mail\', this, \'##title##\')" title="Поделиться новостью в Моё Мире mail.ru"></span>\
			 </li>\
		 </ul>\
	 </div>\
	 <div class="left">\
		 <div class="news_info">\
			 <span class="video_icon"></span>\
			 <a href="user_profile.php?id=##user_id##" target="_blank" class="first_last_name">##user_name##</a> добавил видео в альбом <a href="#" onclick=\"get_videos(##videoalbum_id##, ##user_id##); return;" class="album_news">##album_name##</a>\
			 <div class="date">##date##</div>\
			 <div class="clear"></div>\
		 </div>\
		 <div class="video_news_wrap">\
			 <div class="video_news">\
				 <img video="##link##" width="200" height="150" src="http://img.youtube.com/vi/##link##/1.jpg">\
				 <div class="video_news_title">\
					 ##title##\
				 </div>\
			</div>\
		</div>\
	 </div>\
 </li>';
  
var markup_video_one=
'<div class="video_news">\
	 <img video="##link##" width=\"200\" height=\"150\" src="http://img.youtube.com/vi/##link##/1.jpg">\
	 <div class="video_news_title">\
		 ##title##\
	 </div>\
</div>';
var markup_photo_one=
'<a class="gallery" rel="prettyPhoto[gallery##rel_photo##]" title="##title##" href="user_photos/full_size/##link##">\
	 <img src="user_photos/mini/##link##" />\
 </a>';

var markup_news_photo=
'<li>\
	 <div class="right">\
		 <ul>\
			 <li class="news_btn">\
				 <b class="like_count">##like_count##</b>\
				 <span class="like_icon" title="Проголосовать"></span>\
				 <div class="clear"></div>\
			 </li>\
			 <li class="news_btn">\
				 <b class="unlike_count">##dislike_count##</b>\
				 <span class="unlike_icon" title="Проголосовать"></span>\
				 <div class="clear"></div>\
			 </li>\
			 <li class="news_btn">\
				 <div id="news_icon_comments" title="Перейти к комментариям">\
					 <b>Комментариев: <span>##comments_count##</span></b>\
				 </div>\
			 </li>\
			  <li class="news_btn">\
				 <span class="socnet_fb" onclick="share(\'fb\', this, \'##title##\')" title="Поделиться новостью в Фейсбуке"></span>\
				 <span class="socnet_tw" onclick="share(\'tw\', this, \'##title##\')" title="Поделиться новостью в Твиттере"></span>\
				 <span class="socnet_vk" onclick="share(\'vk\', this, \'##title##\')" title="Поделиться новостью в Вконтакте"></span>\
				 <span class="socnet_ok" onclick="share(\'ok\', this, \'##title##\')" title="Поделиться новостью на Одноклассниках"></span>\
				 <span class="socnet_gp" onclick="share(\'gp\', this, \'##title##\')" title="Поделиться новостью в Google+"></span>\
				 <span class="socnet_mail" onclick="share(\'mail\', this, \'##title##\')" title="Поделиться новостью в Моё Мире mail.ru"></span>\
			 </li>\
		 </ul>\
	 </div>\
	 <div class="left">\
		  <div class="news_info">\
			 <span class="photo_icon"></span>\
			  <a href="user_profile.php?id=##user_id##" target="_blank" class="first_last_name">##user_name##</a> добавил фото в альбом <a href="#" onclick=\"get_photos(##photoalbum_id##, ##user_id##); return;" class="album_news">##album_name##</a>\
			 <div class="date">##date##</div>\
			 <div class="clear"></div>\
		 </div>\
		 <div class="photo_preview_news">\
			 <a class="gallery" rel="prettyPhoto[gallery##rel_photo##]" title="##title##" href="user_photos/full_size/##link##">\
				     <img src="user_photos/mini/##link##" />\
			 </a>\
		 </div>\
	 </div>\
 </li>';
 
 var markup_news_advert=
 '<li>\
	 <div class="right">\
		 <ul>\
			 <li class="news_btn">\
				 <span class="socnet_fb" onclick="share(\'fb\', this, \'##text##\')" title="Поделиться новостью в Фейсбуке"></span>\
				 <span class="socnet_tw" onclick="share(\'tw\', this, \'##text##\')" title="Поделиться новостью в Твиттере"></span>\
				 <span class="socnet_vk" onclick="share(\'vk\', this, \'##text##\')" title="Поделиться новостью в Вконтакте"></span>\
				 <span class="socnet_ok" onclick="share(\'ok\', this, \'##text##\')" title="Поделиться новостью на Одноклассниках"></span>\
				 <span class="socnet_gp" onclick="share(\'gp\', this, \'##text##\')" title="Поделиться новостью в Google+"></span>\
				 <span class="socnet_mail" onclick="share(\'mail\', this, \'##text##\')" title="Поделиться новостью в Моё Мире mail.ru"></span>\
			 </li>\
		 </ul>\
	 </div>\
	 <div class="left">\
		 <div class="news_info">\
			 <span class="advert_icon"></span>\
			  <a href="user_profile.php?id=##user_id##" target="_blank" class="first_last_name">##user_name##</a> добавил новое объявление:\
			 <div class="date">##date##</div>\
			 <div class="clear"></div>\
		 </div>\
		  <div class="advert_news">\
			 <div class="advert_news_block">\
				 <div class="advert_news_rubric">\
					 <b>Рубрика: </b><span class="full_notes" >##rubric##</span >\
				 </div>\
				 <div class="advert_news_category">\
					 <b>Категория: </b><span class="full_notes">##category##</span>\
				 </div>\
			 </div>\
			 <div class="advert_news_text">\
				 ##text##\
			 </div>\
			 <input class="button" type="button" name="advert_contact_popup" value="Контактные данные"/>\
			 <img title="Написать сообщение" name="quick_message" src="images/email_btn.png" style="position:relative; top:8px; cursor: pointer;">\
			 <input type="hidden" name="id" value="##feeds_id##"/>\
			 <input type="hidden" name="phone_h" value="##phone_h##"/>\
			 <input type="hidden" name="email_h" value="##email_h##"/>\
			 <input type="hidden" name="scype_h" value="##skype_h##"/>\
		 </div>\
		 <input type="hidden" name="user_id" value="##user_id##"/>\
	 </div>\
 </li>';

 var markup_no_news='<span class="no_photos">Новостей не найдено</span>';
 
 var markup_photo_actions_content_iframe_video_popup=
 '<span class="date">\
	 Добавлено ##date## |\
 </span>\
 <div class="photo_like">\
	 <b>##like_count##</b><span class="like_mini"></span>\
	 <b>##dislike_count##</b><span class="unlike_mini"></span>\
 </div>';
 
 var markup_iframe_video_popup_comment=
'<div class="photo_comment_body">\
	<div class="photo_comment_info">\
		<span class="first_last_name">##user_name##</span>\
		<span class="date">##date##</span>\
	</div>\
	<div class="photo_comment_text">\
		 ##text##!\
	</div>\
</div>'
